<?xml version="1.0" encoding="UTF-8"?>
<!-- <cfsetting enablecfoutputonly="true" /> -->
<!--
Copyright: (c) 2006 The MachBlog Authors
Authors: Matt Woodward (mpwoodward@gmail.com) & Peter J. Farrell (pjf@maestropublishing.com)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. 
You may obtain a copy of the License at 

http://www.apache.org/licenses/LICENSE-2.0 

Unless required by applicable law or agreed to in writing, software 
distributed under the License is distributed on an "AS IS" BASIS, 
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
See the License for the specific language governing permissions and 
limitations under the License.
	
$Id: services.xml 1182 2007-06-25 21:14:57Z pfarrell $

Notes:
-->
<beans default-autowire="no">
	<!-- AGGREGATOR -->
	<bean id="aggregatorService" 
		class="machblog.org.machblog.aggregator.AggregatorService">
		<property name="aggregatorDAO"><ref bean="aggregatorDAO" /></property>
		<property name="aggregatorGateway"><ref bean="aggregatorGateway" /></property>
		<property name="userFacade"><ref bean="userFacade" /></property>
		<property name="resourceBundleFacade"><ref bean="resourceBundleFacade" /></property>
	</bean>
	<bean id="aggregatorDAO" 
		factory-bean="daoFactory" 
		factory-method="getAggregatorDAO">
		<property name="datasource"><ref bean="datasourceBean" /></property>
		<property name="resourceBundleFacade"><ref bean="resourceBundleFacade" /></property>
	</bean>
	<bean id="aggregatorGateway" 
		factory-bean="gatewayFactory" 
		factory-method="getAggregatorGateway">
		<property name="datasource"><ref bean="datasourceBean" /></property>
	</bean>
	<!-- BLOG -->
	<bean id="blogService" class="machblog.org.machblog.blog.BlogService">
		<property name="blogGateway"><ref bean="blogGateway" /></property>
		<property name="userFacade"><ref bean="userFacade" /></property>
	</bean>
	<bean id="blogGateway" 
		factory-bean="gatewayFactory" 
		factory-method="getBlogGateway">
		<property name="datasource"><ref bean="datasourceBean" /></property>
		<property name="resourceBundleFacade"><ref bean="resourceBundleFacade" /></property>
	</bean>
	<!-- CATEGORY -->
	<bean id="categoryService"
		class="machblog.org.machblog.category.CategoryService">
		<property name="devMode"><value>${devMode}</value></property>
		<property name="categoryDAO"><ref bean="categoryDAO"/></property>
		<property name="categoryGateway"><ref bean="categoryGateway"/></property>
		<property name="userFacade"><ref bean="userFacade"/></property>
	</bean>
	<bean id="categoryDAO"
		factory-bean="daoFactory" 
		factory-method="getCategoryDAO">
		<property name="datasource"><ref bean="datasourceBean" /></property>
		<property name="resourceBundleFacade"><ref bean="resourceBundleFacade" /></property>
	</bean>	
	<bean id="categoryGateway"
		factory-bean="gatewayFactory" 
		factory-method="getCategoryGateway">
		<property name="datasource"><ref bean="datasourceBean" /></property>
		<property name="resourceBundleFacade"><ref bean="resourceBundleFacade" /></property>
	</bean>
	<!-- COMMENT -->
	<bean id="commentService"
		class="machblog.org.machblog.comment.CommentService">
		<property name="commentDAO"><ref bean="commentDAO"/></property>
		<property name="commentGateway"><ref bean="commentGateway"/></property>
		<property name="notificationService"><ref bean="notificationService" /></property>
		<property name="userFacade"><ref bean="userFacade"/></property>
		<property name="udfs"><ref bean="udfs" /></property>
	</bean>
	<bean id="commentDAO"
		factory-bean="daoFactory" 
		factory-method="getCommentDAO">
		<property name="datasource"><ref bean="datasourceBean" /></property>
		<property name="resourceBundleFacade"><ref bean="resourceBundleFacade" /></property>
	</bean>
	<bean id="commentGateway"
		factory-bean="gatewayFactory" 
		factory-method="getCommentGateway">
		<property name="datasource"><ref bean="datasourceBean" /></property>
		<property name="resourceBundleFacade"><ref bean="resourceBundleFacade" /></property>
	</bean>
	<!-- ENTRY -->
	<bean id="entryService"
		class="machblog.org.machblog.entry.EntryService">
		<property name="entryDAO"><ref bean="entryDAO"/></property>
		<property name="entryGateway"><ref bean="entryGateway"/></property>
		<property name="userFacade"><ref bean="userFacade"/></property>
		<property name="notificationService"><ref bean="notificationService" /></property>
		<property name="udfs"><ref bean="udfs" /></property>
	</bean>
	<bean id="entryDAO" 
		factory-bean="daoFactory" 
		factory-method="getEntryDAO">
		<property name="datasource"><ref bean="datasourceBean" /></property>
		<property name="commentGateway"><ref bean="commentGateway"/></property>
		<property name="trackbackGateway"><ref bean="trackbackGateway" /></property>
		<property name="resourceBundleFacade"><ref bean="resourceBundleFacade" /></property>
	</bean>	
	<bean id="entryGateway"
		factory-bean="gatewayFactory" 
		factory-method="getEntryGateway">
		<property name="datasource"><ref bean="datasourceBean" /></property>
		<property name="resourceBundleFacade"><ref bean="resourceBundleFacade" /></property>
	</bean>
	<!-- FACTORIES -->
	<bean id="daoFactory"
		class="machblog.org.machblog.factories.DAOFactory">
		<constructor-arg name="datasource"><ref bean="datasourceBean" /></constructor-arg>
	</bean>
	<bean id="gatewayFactory"
		class="machblog.org.machblog.factories.GatewayFactory">
		<constructor-arg name="datasource"><ref bean="datasourceBean" /></constructor-arg>
	</bean>
	<!-- LOGIN -->
	<bean id="loginService"
		class="machblog.org.machblog.security.LoginService">
		<property name="loginGateway"><ref bean="loginGateway"/></property>
		<property name="notificationService"><ref bean="notificationService" /></property>
		<property name="passwordService"><ref bean="passwordService" /></property>
	</bean>
	<bean id="loginGateway"
		factory-bean="gatewayFactory" 
		factory-method="getLoginGateway">
		<property name="datasource"><ref bean="datasourceBean" /></property>
		<property name="userFacade"><ref bean="userFacade"/></property>
		<property name="resourceBundleFacade"><ref bean="resourceBundleFacade" /></property>
		<property name="userService"><ref bean="userService" /></property>
	</bean>
	<!-- RESOURCE BUNDLE -->
	<bean id="resourceBundleService" class="machblog.org.machblog.i18n.ResourceBundleService">
		<property name="resourceBundleFacade"><ref bean="resourceBundleFacade" /></property>
	</bean>
	<bean id="resourceBundleFacade"
		class="machblog.org.machblog.facades.ResourceBundleFacade">
		<property name="resourceBundle"><ref bean="resourceBundle" /></property>
		<property name="localeUtils"><ref bean="localeUtils" /></property>
	</bean>
	<bean id="resourceBundle" class="machblog.org.hastings.locale.ResourceBundle">
		<property name="rbFile"><value>${rbFile}</value></property>
		<property name="rbLocale"><value>${rbLocale}</value></property>
		<property name="markDebug"><value>${markDebug}</value></property>
	</bean>
	<bean id="localeUtils" class="machblog.org.hastings.locale.utils">
		<property name="rbLocale">
			<value>${rbLocale}</value>
		</property>
	</bean>
	<!-- RSS -->
	<bean id="rssService" class="machblog.org.machblog.rss.RssService">
		<property name="entryService"><ref bean="entryService" /></property>
		<property name="resourceBundleService"><ref bean="resourceBundleService" /></property>
		<property name="udfs"><ref bean="udfs"/></property>
	</bean>
	<!-- SUBSCRIBER -->
	<bean id="subscriberService" class="machblog.org.machblog.subscriber.SubscriberService">
		<property name="subscriberGateway"><ref bean="subscriberGateway" /></property>
		<property name="subscriberDAO"><ref bean="subscriberDAO" /></property>
		<property name="userFacade"><ref bean="userFacade" /></property>
		<property name="udfs"><ref bean="udfs" /></property>
		<property name="notificationService"><ref bean="notificationService" /></property>
	</bean>
	<bean id="subscriberGateway" factory-bean="gatewayFactory" factory-method="getSubscriberGateway">
		<property name="datasource"><ref bean="datasourceBean" /></property>
	</bean>
	<bean id="subscriberDAO" factory-bean="daoFactory" factory-method="getSubscriberDAO">
		<property name="datasource"><ref bean="datasourceBean" /></property>
		<property name="resourceBundleFacade"><ref bean="resourceBundleFacade" /></property>
	</bean>
	<!-- SYS-->
	<bean id="captchaService"
		class="machblog.org.machblog.captcha.captchaService"
		init-method="setup">
		<constructor-arg name="configFile"><value>${captchaConfigFile}</value></constructor-arg>
	</bean>
	<bean id="datasourceBean"
		class="machblog.org.machblog.datasource.Datasource">
		<property name="dsn"><value>${dsn}</value></property>
		<property name="dbType"><value>${dbType}</value></property>
		<property name="userName"><value>${dbUserName}</value></property>
		<property name="password"><value>${dbPassword}</value></property>
	</bean>
	<bean id="notificationConfigBean"
		class="machblog.org.machblog.notification.NotificationConfig">
		<property name="smtpMailerId"><value>${smtpMailerId}</value></property>
		<property name="smtpServer"><value>${smtpServer}</value></property>
		<property name="smtpUsername"><value>${smtpUsername}</value></property>
		<property name="smtpPassword"><value>${smtpPassword}</value></property>
		<property name="smtpCharset"><value>${smtpCharset}</value></property>
		<property name="smtpSpoolEnabled"><value>${smtpSpoolEnabled}</value></property>
		<property name="emailAuthor"><value>${emailAuthor}</value></property>
		<property name="emailComments"><value>${emailComments}</value></property>
		<property name="emailError"><value>${emailError}</value></property>
		<property name="emailWebmaster"><value>${emailWebmaster}</value></property>
	</bean>
	<bean id="notificationService"
		class="machblog.org.machblog.notification.NotificationService">
		<property name="notificationConfigBean"><ref bean="notificationConfigBean"/></property>
	</bean>
	<bean id="passwordService" class="machblog.org.machblog.security.PasswordService">
		<property name="udfs"><ref bean="udfs" /></property>
		<property name="datasource"><ref bean="datasourceBean" /></property>
	</bean>
	<bean id="userFacade"
		class="machblog.org.machblog.facades.UserFacade" />
	<bean id="udfs"
		class="machblog.org.machblog.utils.udfs">
		<constructor-arg name="eventParameter"><value>${eventParameter}</value></constructor-arg>
		<constructor-arg name="blogUrl"><value>${blogUrl}</value></constructor-arg>
		<constructor-arg name="defaultUrlBase"><value>${urlBase}</value></constructor-arg>
		<constructor-arg name="urlDelimiters"><value>${urlDelimiters}</value></constructor-arg>
		<constructor-arg name="moduleDelimiter"><value>${moduleDelimiter}</value></constructor-arg>
	</bean>
	<!-- TRACKBACK -->
	<bean id="trackbackService" class="machblog.org.machblog.trackback.TrackbackService">
		<property name="trackbackDAO"><ref bean="trackbackDAO" /></property>
		<property name="trackbackGateway"><ref bean="trackbackGateway" /></property>
		<property name="userFacade"><ref bean="userFacade" /></property>
	</bean>
	<bean id="trackbackDAO" 
		factory-bean="daoFactory" 
		factory-method="getTrackbackDAO">
		<property name="datasource"><ref bean="datasourceBean" /></property>
		<property name="resourceBundleFacade"><ref bean="resourceBundleFacade" /></property>
	</bean>
	<bean id="trackbackGateway" 
		factory-bean="gatewayFactory" 
		factory-method="getTrackbackGateway">
		<property name="datasource"><ref bean="datasourceBean" /></property>
		<property name="resourceBundleFacade"><ref bean="resourceBundleFacade" /></property>
	</bean>
	<!-- USER -->
	<bean id="userService"
		class="machblog.org.machblog.user.UserService">
		<property name="userDAO"><ref bean="userDAO"/></property>
		<property name="userGateway"><ref bean="userGateway"/></property>
		<property name="userFacade"><ref bean="userFacade"/></property>
		<property name="passwordService"><ref bean="passwordService" /></property>
	</bean>
	<bean id="userDAO"
		factory-bean="daoFactory" 
		factory-method="getUserDAO">
		<property name="datasource"><ref bean="datasourceBean" /></property>
		<property name="resourceBundleFacade"><ref bean="resourceBundleFacade" /></property>
	</bean>
	<bean id="userGateway"
		factory-bean="gatewayFactory" 
		factory-method="getUserGateway">
		<property name="datasource"><ref bean="datasourceBean" /></property>
	</bean>
</beans>